<?php
/**
 * Configuración inicial
 */
error_reporting(E_ALL | E_STRICT);
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
date_default_timezone_set('America/Buenos_Aires');
/**
 * Definición de directorios
    OBS: ZendFramwork esta fuera de la aplicacion
 */
set_include_path( 
    '.'                      . PATH_SEPARATOR .
    '../'                    . PATH_SEPARATOR .
    '../library'             . PATH_SEPARATOR .
    '../application/model'   . PATH_SEPARATOR .
    '../application/admin/views'. PATH_SEPARATOR .
    '../application/views'. PATH_SEPARATOR .
    get_include_path());
/**
 * Carga de clases que sean necesarias
 */
include "Zend/Loader.php";
Zend_Loader::registerAutoload();

$request = new Zend_Controller_Request_Http();
$response = new Zend_Controller_Response_Http();
$response->setHeader('Content-type','text/html; charset=utf-8');

/**
 * Setup controller
 */
Zend_Controller_Front::getInstance()
	->setParam( 'config', 'config.default.ini' )
	->setControllerDirectory( array(
        'default'=> '../application/controllers',
        'admin'=> '../application/admin/controllers'))
	->throwExceptions(true)
    ->registerPlugin( new MA_Controller_Plugin_Config())
    ->registerPlugin( new MA_Controller_Plugin_Layout())
    ->registerPlugin( new MA_Controller_Plugin_View())
    ->registerPlugin( new MA_Controller_Plugin_Backoffice())
    ->dispatch($request, $response);

